<?php namespace app\admin\controller;

class Tag extends \system\model\Tag{
//动作
    public function index(){
    //此处书写代码...
        $data=$this->get()->toArray();
     View::with('data',$data);
        return view();
    }
//添加
    public function add(){
        if(IS_POST){
            $resa=$this->tag_add();
            if($resa){
                message('添加成功','index','success');
            }
            message('添加失败','add','error');
        }
        return view();
    }
//删除
    public function del(){

            $a=$this->tag_del();
            //p($a);
            if($a){
                message('删除成功','index','success');
            }
            message('删除失败','index','error');
            return view();
        }
//编辑
    public function edit(){

       $edit= $this->tag_edit();
        if(IS_POST){
            if($edit){
                message('编辑成功','index','success');
            }
            message('编辑失败','edit','error');
        }


        return view();
    }


}
